<%@ page import="cn.com.entity.Admin" %><%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2020/11/8
  Time: 22:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>right</title>
    <style type="text/css" >
        html,body{
            width: 250px;
        }
        .content{
            width: 200px;
            margin: 0 auto;
            background: white;
            margin-top: 40px;
            padding: 10px;
            box-sizing: border-box;
            font: 20px "华文行楷";
            line-height: 50px;
            text-align: center;
            color: red;
            font-weight: 700;

        }
        .lianjie{
            width: 200px;
            margin: 0 auto;
            margin-top: 20px;
        }
        .lianjie a{
            margin-bottom: 10px;
            display: block;
            text-decoration: none;
            color: white;
        }
        .lianjie a:hover div{
            border: 2px solid red;
            color: red;
        }
        .lianjie a div{
            width: 200px;
            height: 50px;
            margin: 0 auto;
            border: 2px solid white;
            font: 20px "华文行楷";
            line-height: 50px;
            text-align: center;
            letter-spacing: 2px;
        }
    </style>
    <script src="/WebContent/JQuery/jquery-3.4.1.js" type="text/javascript"></script>
</head>
<body>
<%
    Admin admin = (Admin)session.getAttribute("admin");
%>
     <div class="content" id="content">
         欢迎您，<span id="user-name"></span>管理员
     </div>
     <script>
         var usernames = document.getElementById("user-name");
         var content = document.getElementById("content");
         usernames.style.color = 'red';
         content.style.background = 'white';
         content.style.color = 'black';
         content.style.border = '10px solid red';
         usernames.innerHTML = '<%=admin.getAdminUsername()%>';


         //退出
         $(document).ready(function () {
             $("#tuichu ").click(function () {
                 if(confirm("确认注销吗？")){
                     $.ajax({
                         url:"/AdminLoginServlet?type=tc",
                         type:"get",
                         dataType:"text",
                         success:function (data) {
                             if(data == "1"){
                                 alert("注销成功！");
                             }else{
                                 alert("注销失败！")
                             }
                         },
                         error:function (error) {
                             alert("系统异常！");
                         }
                     });
                     parent.location.href="/WebContent/HTML/AdminLogin.jsp";
                     return true;
                 }else{return false;}
             })
         })
     </script>

     <div class="lianjie">
         <a href="javascript:alert('校长信箱：president@nmu.edu.cn')">
             <div class="list">
                校长信箱
             </div>
         </a>
         <a href="javascript:alert('客服QQ:1174586985')">
             <div class="list">
                 联系客服
             </div>
         </a>
         <a href="javascript:void(0);" id="tuichu">
             <div class="list">
                  退出系统
             </div>
         </a>
     </div>
</body>
</html>